//
//  DCHViewControllerJINGHUA.m
//  DCH-BaiSiBuDeJie
//
//  Created by apple on 16/10/18.
//  Copyright © 2016年 xiaomage. All rights reserved.
//

#import "DCHViewControllerJINGHUA.h"
#import "UIBarButtonItem+Item.h"

@interface DCHViewControllerJINGHUA ()

@end

@implementation DCHViewControllerJINGHUA

- (void)viewDidLoad {
    [super viewDidLoad];
    [self stackTop];
    
   
}

- (void)stackTop
{
    //设置导航条内容 =>栈顶控制器的navigationItem决定
    self.navigationItem.titleView =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"MainTitle"]];


    
//    UIButton *btn =[UIButton buttonWithType:UIButtonTypeCustom];
//    [btn setImage:[UIImage imageNamed:@"nav_item_game_icon"] forState:UIControlStateNormal];
//    [btn setImage:[UIImage imageNamed:@"nav_item_game_click_icon"] forState:UIControlStateHighlighted];
//    [btn sizeToFit];
//    [btn addTarget:self action:@selector(action) forControlEvents:UIControlEventTouchUpInside];
//    
//    //左边
//    self.navigationItem.leftBarButtonItem =[[UIBarButtonItem alloc]initWithCustomView:btn];
    
    
    //右边
    //    UIButton *btn2 =[UIButton buttonWithType:UIButtonTypeCustom];
    //    [btn2 setImage:[UIImage imageNamed:@"navigationButtonRandom"] forState:UIControlStateNormal];
    //    [btn2 setImage:[UIImage imageNamed:@"navigationButtonRandomClick"] forState:UIControlStateHighlighted];
    //    [btn2 sizeToFit];
    //
    //    [btn2 addTarget:self action:@selector(action1) forControlEvents:UIControlEventTouchUpOutside];
    //    self.navigationItem.rightBarButtonItem =[[UIBarButtonItem alloc]initWithCustomView:btn2];
    
    
    //左边
    self.navigationItem.leftBarButtonItem =[UIBarButtonItem itemWithImage:[UIImage imageNamed:@"nav_item_game_icon"] highImage:[UIImage imageNamed:@"nav_item_game_click_icon"] target:self action:@selector(gameClick)];


    //右边
    UIBarButtonItem *item =[UIBarButtonItem itemWithImage:[UIImage imageNamed:@"navigationButtonRandom"] highImage:[UIImage imageNamed:@"navigationButtonRandomClick"] target:nil action:nil];
    self.navigationItem.rightBarButtonItem =item;
}

- (void)gameClick
{
    NSLog(@"点击");
}


@end
